package com.yuandian.api.business_monitor;

public enum IndicatorObjEnum {
	system("1", "系统", "sys_alarm_indicator_obj_type", "ads_busi_sys_req_trend_m", "system_id, system_name"),
	business("2", "业务", "sys_alarm_indicator_obj_type", "ads_business_detail_stat_m", "business_code, business_name, system_id, system_name"),
	segment("3", "网端", "sys_alarm_indicator_obj_type", "ads_busi_sys_segment_trend_m", "segment_id, segment_name, system_id, system_name"),
	//暂时没此指标对象
//        component("4", "组件", "sys_alarm_indicator_obj_type",  "", ""),
	//暂时没此指标对象
//        step("5", "步骤", "sys_alarm_indicator_obj_type", "", ""),
	;

	/**
	 * 对应字典键值
	 */
	private String value;

	/**
	 * 对应字典标签
	 */
	private String label;

	/**
	 * 对应字典类型
	 */
	private String dictType;

	/**
	 * 对应查询的表名（表名前缀）
	 */
	private String tableName;

	/**
	 * 分组的条件
	 */
	private String groupByCondition;

	IndicatorObjEnum(String value, String label, String dictType, String tableName, String groupByCondition) {
		this.value = value;
		this.label = label;
		this.dictType = dictType;
		this.tableName = tableName;
		this.groupByCondition = groupByCondition;
	}

	public String getValue() {
		return value;
	}

	public String getLabel() {
		return label;
	}

	public String getDictType() {
		return dictType;
	}

	public String getTableName() {
		return tableName;
	}

	public String getGroupByCondition() {
		return groupByCondition;
	}

	/**
	 * 通过value获取指标对象枚举
	 */
	public static IndicatorObjEnum getEnumByValue(String value) {
		for (IndicatorObjEnum indicatorObjEnum : IndicatorObjEnum.values()) {
			if (indicatorObjEnum.value.equals(value)) {
				return indicatorObjEnum;
			}
		}
		return null;
	}
}
